const Const = {
  QXBAPIVERSION: '4.7.0.3',
  VINURL: 'http://api-2.nanxinwang.com/',
  VINCONFIGURATION: 'http://api-2.nanxinwang.com/',

  CCWURL: 'http://www.chechong.com',
  CCWCHILDPPURL: 'http://www.chechong.com/Index/showSeries',
  CCWSIMPLEURL: 'http://www.chechong.com/Index/showSimple',

  ESCFBASEURL: 'http://www.che168.com',
  ESCFAMILYPPURL: 'http://www.che168.com/Handler/ScriptCarList_V1.ashx?needData=1',
  ESCFCITYDATA: 'http://www.che168.com/js/city.js',
  ESCFAREADATA: 'http://www.che168.com/js/AreaData.js',
  ESCFAMILYCHILDPPURL: 'http://www.che168.com/Handler/ScriptCarList_V1.ashx?seriesGroupType=2&needData=2&bid=',
  ESCFAMILYSIMPLEURL: 'http://www.che168.com/Handler/ScriptCarList_V1.ashx?seriesGroupType=2&needData=3&seriesid=',
  ESCFEVAURL: 'http://www.che168.com/Evaluate/v2/EvaCar.aspx?',

  CTHURL: 'https://www.che300.com',
  CTHEVABASEURL: 'https://dingjia.che300.com/',
  CTHCITYURL: 'https://ssl-meta.che300.com/location/all_city.json',
  CTHCHILDPPURLL: 'https://ssl-meta.che300.com/meta/series/series_brand',
  CTHSIMPLEURL: 'https://ssl-meta.che300.com/meta/model/model_series',

  CCWTYPE: 1,
  CTHTYPE: 2,
  ESCFTYPE: 3,

  toDecimal2: (x) => {
    var f = parseFloat(x);
    if (isNaN(f)) {
      return false;
    }
    var f = Math.round(x * 100) / 100;
    var s = f.toString();
    var rs = s.indexOf('.');
    if (rs < 0) {
      rs = s.length;
      s += '.';
    }
    while (s.length <= rs + 2) {
      s += '0';
    }
    return s;
  },

  deepCopy: (p, c) => {　　　　
    var c = c || {};　　　　
    for (var i in p) {　　　　　　
      if (typeof p[i] === 'object') {　　　　　　　　
        c[i] = (p[i].constructor === Array) ? [] : {};　　　　　　　　
        deepCopy(p[i], c[i]);　　　　　　
      } else {　　　　　　　　　
        c[i] = p[i];　　　　　　
      }　　　　
    }　　　　
    return c;　　
  }
}

export default {
  Const
}